
  <include file="Public/header" />
	<div class="x12 padding-top padding border-bottom">
		<h3 class="x3">单页管理</h3>
		<a href="{:U('/Admin/News/page_add')}" class="float-right bg-sub button icon-plus" type="button" > 添加单页</a>
      </div>
      <div class="x12 padding">
      
        <table class="table table-bordered table-hover">
          <tbody>
            <tr>
             <th>单页标题</th><th>创建时间</th><th>操作</th>
            </tr>

            <volist name="lists" id="vo">
            <tr id="tr{$vo.id}" class="height">
              <td>{$vo.title}</td>
              <td>{$vo.time|date="Y-m-d H:i",###}</td>
              <td>
                <button class="del button button-small bg-sub" sid="{$vo.id}" sname="{$vo.title}">删除</button>
                <a href="__MODULE__/News/page_edit/id/{$vo.id}" class=" button button-small bg-sub" >编辑</a>

              </td>
            </tr>


            </volist>

          </tbody>
        </table>
		<div class="margin-big-top">
          <ul class="pagination pagination-group">
            {$page}
          </ul>
        </div>
        </div>
    </div>
  	<!-- 底部 -->
    <include file="foot" />
  </div>
<script type="text/javascript">
$(function(){
    //删除
    $('.del').click(function(){
        var sid = $(this).attr('sid');
        layer.confirm('确定要删除 "'+ $(this).attr('sname') +'" 吗？', {icon: 3},function(){
            $.ajax({
                type: 'POST',
                url: '{:U('/Admin/News/news_del')}',
                data:{
                    id:sid
                },
                dataType: "json",
                beforeSend: function() {
                  layer.closeAll();
                  layer.load(2,{shade: [0.1,'#000']});
                },
                success: function(data){
                  layer.closeAll();
                    if (data.status == 1) {
                        
                        layer.msg(data.info, {
                            shift: 2,
                            time: 1000,
                            shade: [0.1,'#000'],
                            end: function(){
                                $("#tr"+sid).remove();
                            }
                        });
                    }else{
                        layer.alert(data.info,{icon: 5});
                    }
                }
            });
        });
    });


});

</script>
</body>
</html>